import { IsString, IsNumber, IsOptional, IsEnum } from 'class-validator';

export enum PaymentMethod {
  WECHAT_NATIVE = 'wechat_native',
  WECHAT_H5 = 'wechat_h5',
  WECHAT_JSAPI = 'wechat_jsapi',
  ALIPAY_PAGE = 'alipay_page',
  ALIPAY_WAP = 'alipay_wap',
}

export class CreatePaymentDto {
  @IsString()
  orderId: string;

  @IsNumber()
  amount: number;

  @IsEnum(PaymentMethod)
  paymentMethod: PaymentMethod;

  @IsString()
  @IsOptional()
  openid?: string; // 微信JSAPI支付需要

  @IsString()
  @IsOptional()
  returnUrl?: string;
}




